import AbstractDesignerController from 'framework/core/AbstractDesignerController';

// 根据产品编码获取图层信息
export const getControllers = (
  controller: Record<string, AbstractDesignerController>,
  productCode: number,
): AbstractDesignerController[] => {
  // 遍历controller 对象
  const controllers: AbstractDesignerController[] = [];
  Object.values(controller).forEach((item) => {
    // 判断产品编码是否相等
    if (item.config?.base?.code === productCode) {
      controllers.push(item);
    }
  });
  return controllers;
};
